<? require_once("sitemap.php"); ?>
<?
	$alltables = mysql_query("SHOW TABLES",$db);
	while ($table = mysql_fetch_assoc($alltables))
	{   
		foreach ($table as $db => $tablename)   
		{       
			$sql = "OPTIMIZE TABLE '".$tablename."'";
			echo $sql . "<br>";
			mysql_query($sql);
				 echo (mysql_error());   
		}   
	}
?>